{template 'common/header'}
<ul class="nav nav-tabs">
	<li {if $operation == 'edit'}class="active"{/if}><a href="{php echo $this->createWebUrl('note', array('op' => 'edit','bid'=>$bid));}">添加说明项</a></li>
	<li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('note', array( 'op' => 'display','bid'=>$bid));}">说明项管理</a></li>


	<li ><a
			href="{php echo $this->createWebUrl('brand', array( 'op' => 'display'));}">品牌管理</a></li>
	
</ul>

{if $operation == 'edit'}
<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
		<input type="hidden" name="id" value="{$item['id']}" />
		<input type="hidden" name="aid" value="{php echo $aid}" />

		<div class="panel panel-default">
			<div class="panel-heading">
				{$brand['bname']} 说明项设置
			</div>
			<div class="panel-body">

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">说明标题</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="title" class="form-control" value="{$item['title']}" />
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">说明内容</label>
					<div class="col-sm-9 col-xs-12">
						<textarea style="height:400px; width:100%;" class="span7" id="note" name="note" cols="70">{$item['note']}</textarea>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-sm-9 col-xs-12">
						<input name="submit" type="submit" value="提交" class="btn btn-primary span3">
						<input type="hidden" name="token" value="{$_W['token']}" />
					</div>
				</div>


			</div>

			</div>

	</form>
</div>
<script type="text/javascript">

	require(['jquery', 'util'], function($, u){
		$(function(){
			u.editor($('#note')[0]);

		});

	});

</script>

{elseif $operation == 'display'}
<div class="main">

	<div class="panel panel-default">
		<div class="table-responsive panel-body">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="min-width:150px;">说明标题</th>


					<th style="text-align:right; min-width:60px;">操作</th>
				</tr>
			</thead>
			<tbody>
			 {loop $list $item}
				<tr>
					<td>{$item['title']}</td>


					<td style="text-align:right;width:300px">
				
						<a href="{php echo $this->createWebUrl('note', array( 'id' => $item['id'], 'op' => 'edit','bid'=>$bid))}" title="编辑" class="btn btn-small"><i class="glyphicon glyphicon-edit"></i>编辑</a>
						<a href="{php echo $this->createWebUrl('note', array( 'id' => $item['id'], 'op' => 'delete','bid'=>$bid))}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" title="删除" class="btn btn-small"><i class="glyphicon glyphicon-remove"></i>删除</a>
					</td>
				</tr>
				{/loop} 
			</tbody>
			
		</table>
		</div>
	</div>
</div>
{/if}
{template 'common/footer'}